package com.weilai.common.service;

import com.weilai.common.dao.DrawRecordMapper;
import com.weilai.common.model.DrawRecord;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by Song on 2017/6/4.
 */
@Service
public class DrawRecordService {
    @Autowired
    DrawRecordMapper drawRecordMapper;

    public Integer updateState(DrawRecord drawRecord) {
        return drawRecordMapper.updateByPrimaryKeySelective(drawRecord);
    }

    public DrawRecord findAll() {
        return drawRecordMapper.selectAll();
    }

    public List<DrawRecord> findUserOfPrize(DrawRecord drawRecord) {
        List<DrawRecord> DrawRecordList = drawRecordMapper.findUserOfPrize(drawRecord);
        return DrawRecordList;
    }

    public List<DrawRecord> findByWeiXin(String weiXinNumber) {
        List<DrawRecord> DrawRecordList = drawRecordMapper.findByWeiXin(weiXinNumber);
        return DrawRecordList;
    }

    public void add(DrawRecord drawRecord) {
        drawRecordMapper.insert(drawRecord);
    }
}
